Skip to content

feat: tmux-hooks のハードブロックを非ブロックのリマインダーに降格(#111、v0.61.0)#126

Merged
okash1n merged 1 commit into
mainfrom
issue/111-tmux-demote
Jun 12, 2026
Merged

feat: tmux-hooks のハードブロックを非ブロックのリマインダーに降格(#111、v0.61.0)#126
okash1n merged 1 commit into
mainfrom
issue/111-tmux-demote

Conversation

@okash1n

@okash1n okash1n commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

概要

LLM 性能監査計画 #121 の P2-05(#111)。dev サーバーの TMUX 外実行ハードブロック(exit 2)を撤廃し、ネイティブ background 実行と協調する非ブロックのリマインダーに降格する。

変更内容

  • check-bash.sh 書換: (1) run_in_background=true は即 exit 0(出力なし)— native background 実行の妨害を解消、(2) TMUX 外の foreground dev サーバーは exit 0 + stderr 1 行「prefer run_in_background(永続セッションが必要なら tmux)」、(3) npm test / cargo build / docker 等への「Consider running in tmux」定常 advisory を削除
  • 表記更新: feature.json description / README ja・en / i18n STR_HOOKS_TMUX / docs/wizard-config-mapping ja・en を新挙動(非ブロック)に統一
  • テスト: 挙動テスト 4 件追加(run_in_background 即許可・foreground リマインダー・advisory 廃止・TMUX 内沈黙)、既存 fixture テストの期待値を rc 2→0 に更新(env -u TMUX で隔離)

検証

  • shellcheck green / unit 343/343 / scenarios 44 Pass + 1 Skip
  • 内部レビュー(code-reviewer agent): medium 1 件(テストのソース静的照合)+ low 2 件(TMUX 内テスト欠如・docs 旧記述)→ すべて修正済み

Closes #111

- run_in_background=true は即許可(native background 実行との衝突解消)
- TMUX 外 foreground dev サーバーは exit 0 + 1 行リマインダーへ降格
- npm test / cargo build 等への定常 advisory を削除
- README/i18n/docs の旧ブロック前提記述を更新、挙動テスト 4 件追加

Closes #111
Copilot AI review requested due to automatic review settings June 12, 2026 01:27
@okash1n okash1n merged commit 6521dd5 into main Jun 12, 2026
12 checks passed
@okash1n okash1n deleted the issue/111-tmux-demote branch June 12, 2026 01:30

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 770b1f051a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

echo '[Hook] Use: tmux new-session -d -s dev "npm run dev"' >&2
echo '[Hook] Then: tmux attach -t dev' >&2
exit 2
echo '[Hook] Reminder: prefer run_in_background for dev servers (or tmux new-session for a persistent session)' >&2

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use a visible hook response for the reminder

When this PreToolUse hook sees a foreground dev server outside tmux, it writes the reminder to stderr but then falls through to exit 0. In Claude Code command hooks, exit 0 only processes stdout JSON and otherwise keeps output in debug; stderr is fed back for exit 2 or non-zero hook errors per the hooks reference, so the intended non-blocking reminder is silent in real sessions even though the new tests inspect the script's raw stderr. Please return a documented JSON response such as systemMessage/hookSpecificOutput.additionalContext, or another supported non-blocking signal, instead.

Useful? React with 👍 / 👎.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the tmux-hooks feature to stop hard-blocking dev server launches outside tmux (exit 2) and instead provide a non-blocking reminder aligned with Claude Code’s native run_in_background support. This reduces friction with background execution while keeping a lightweight nudge for foreground dev servers started outside tmux.

Changes:

  • Adjust tmux-hooks Bash hook behavior: allow run_in_background=true silently; emit a single stderr reminder (exit 0) only for foreground dev servers outside tmux; remove always-on advisory noise for build/test commands.
  • Synchronize user-facing descriptions across README, i18n strings, feature metadata, and wizard config mapping docs to reflect the new non-blocking behavior.
  • Add/update unit tests to cover the new behavior (background pass-through, foreground reminder, advisory removal, and silence inside tmux) and update fixture expectations from rc 2 → 0.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/unit/test-runtime-hooks.sh Adds unit coverage for the new tmux-hooks reminder/pass-through behavior.
tests/unit/test-hook-fixtures.sh Updates fixture smoke test to expect non-blocking behavior (rc 0 + reminder text).
README.md Updates hook summary table to reflect the new “non-blocking reminder” semantics.
README.en.md Same as above for English README.
i18n/ja/strings.sh Updates wizard hook label/description to match new behavior (JA).
i18n/en/strings.sh Updates wizard hook label/description to match new behavior (EN).
features/tmux-hooks/scripts/check-bash.sh Implements the new non-blocking reminder logic and removes advisory noise.
features/tmux-hooks/feature.json Updates feature description to reflect reminder behavior instead of blocking.
docs/wizard-config-mapping.md Updates wizard mapping description to match new behavior (JA).
docs/wizard-config-mapping.en.md Updates wizard mapping description to match new behavior (EN).
CHANGELOG.md Adds v0.61.0 entry documenting the behavior change and rationale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[P2-05] tmux-hooks のハードブロックをリマインダーに降格(native background 実行との衝突解消)

2 participants